<?php


namespace App\Model;

use PhalApi\Model\NotORMModel as NotORM;

class UserAddress extends NotORM
{
    public function getUserAddressByUid($user_id)
    {
        return $this->getORM()->where('uid', $user_id)->fetchAll();
    }

    public function insertUserAddressInfo($userAddress_name, $userAddress_phone, $userAddress_detail, $userAddress_uid)
    {
        $data = array('name' => $userAddress_name, 'phone' => $userAddress_phone, 'detail' => $userAddress_detail, 'uid' => $userAddress_uid, 'flag' => 1);
        $orm = $this->getORM();
        $orm->insert($data);
        return $orm->insert_id();
    }
    public function getUserAddressByUaId($ua_id)
    {
        return $this->getORM()->where('id', $ua_id)->fetchOne();
    }
}